﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S.Archives.Read.Api.Application.Command;

namespace S.Archives.Read.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ProvideController : ControllerBase
    {
        private IMediator mediator;
        public ProvideController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 挑选种公种母
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        /// 
        [HttpGet("SelMaleEmale")]
        public async Task<IActionResult> SelMaleEmale(int id)
        {
            
            var result= await mediator.Send(new SelMaleEmaleCommand() { FileType= id });
            return Ok(result);
        }
        /// <summary>
        /// 根据羊只类型获取耳号下拉框
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        [HttpGet("SelMaleEmaleSel")]

        public async Task<IActionResult> SelMaleEmaleSel(int id)
        {       
            var reault = await mediator.Send(new SelMaleEmaleSelCommand() { FileType=id});
            return Ok(reault);
        }
        /// <summary>
        /// 配种下拉框空怀的(江建浩使用)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        [HttpGet("MatingspeciesSel")]

        public async Task<IActionResult> MatingspeciesSel(int id)
        {
            var reault = await mediator.Send(new MatingspeciesSelCommand() { FileType = id });
            return Ok(reault);
        }
    }
}
